import { UserLayout, BasicLayout, RouteView, BlankLayout, PageView } from '@/components/layouts'
export const asyncRouterMap = [
  {
    path: '/',
    name: 'index',
    component: BasicLayout,
    meta: { title: '首页' },
    redirect: '/dashboard/analysis',
    children: [
        {
            path: '/dashboard',
            name: 'dashboard',
            redirect: '/dashboard/analysis',
            component: RouteView,
            meta: { title: '仪表盘', keepAlive: true, icon: 'dashboard', permission: [ 'dashboard' ] },
            children: [
              {
                path: '/dashboard/analysis',
                name: 'Analysis',
                component: () => import('@/views/dashboard/Analysis'),
                meta: { title: '分析页', keepAlive: false, permission: [ 'dashboard' ] }
              }
            ]
        },
          {
              path: '/users',
              name: 'list',
              component: PageView,
              redirect: '/users/user-list',
              meta: { title: '用户管理', icon: 'user', permission: [ 'user' ]},
              children: [
                  {

                      path: '/users/user-list',
                      name: 'UserList',
                      component: () => import('@/views/users/UserList'),
                      meta: { title: '用户', keepAlive: true, permission: [ 'user' ] }
                  },
                  {
                      path: '/users/studentList',
                      name: 'StudentList',
                      component: () => import('@/views/users/StudentList'),
                      meta: { title: '学生', keepAlive: true, permission: [ 'user' ] }
                  },
                  {
                      path: '/users/teacherList',
                      name: 'TeacherList',
                      component: () => import('@/views/users/TeacherList'),
                      meta: { title: '教师', keepAlive: true, permission: [ 'user' ] }
                  },
          ]
          },
          //  exame   考试管理
      {
            path: '/exame',
                name: 'list',
              component: PageView,
              redirect: '/exame/exame-index',
              meta: { title: '考试管理', icon: 'table', permission: [ 'exame' ] },
            children: [
                {
                    path: '/exame/exameList',
                    name: 'ExameList',
                    component: () => import('@/views/exame/ExameList'),
              meta: { title: '考试管理', keepAlive: true, permission: [ 'exame' ] },
          },
          {
                    path: '/exame/video-index',
                    name: 'VideoIndex',
                    redirect: '/exame/videoList',
                    component: () => import('@/views/exame/VideoList'),
              meta: { title: '视频管理', keepAlive: true, hidden: true,  permission: [ 'exame' ]  },
              hideChildrenInMenu: true,
                  children: [
              {
                  path: '/exame/videoList',
                  name: 'VideoList',
                  component: () => import('@/views/exame/VideoList'),
              meta: { title: '视频管理', hidden: true,keepAlive: true, permission: [ 'exame' ]  }
          }
          ]
          }
          ]
      },{
           path: '/setting',
           name: 'list',
           component: PageView,
           redirect: '/apps/app-list',
           meta: { title: '设置', icon: 'setting', permission: [  'setting' ] },
           children: [
				{
					   path: '/setting/cloud',
					 name: 'Cloud',
					   component: () => import('@/views/site/CloudSetting'),
					   meta: { title: '云对接', keepAlive: true, permission: [ 'setting' ] }
				  },
                  {
                      path: '/setting/subjectVersion',
                          name: 'SubjectVersion',
                      component: () => import('@/views/subject/SubjectVersionList'),
                      meta: { title: '教材版本', keepAlive: true, permission: [ 'setting' ] }
                  },
                  {
                      path: '/setting/subjectList',
                          name: 'SubjectList',
                      component: () => import('@/views/subject/SubjectList'),
                      meta: { title: '学科', keepAlive: true, permission: [ 'setting' ] }
                  },
                    // 新建班级
                  {
                      path: '/setting/clazzList',
                      name: 'ClazzList',
                      component: () => import('@/views/subject/ClazzList'),
                      meta: { title: '班级', keepAlive: true, permission: [ 'setting' ] }
                  },
                  {
                      path: '/setting/subjectCateList',
                          name: 'SubjectCateList',
                      component: () => import('@/views/subject/SubjectCateList'),
                      meta: { title: '学科知识点', keepAlive: true, permission: [ 'setting' ] }
                  }
              ]
              },
        //实验管理 管理员端 experiment
      {
            path: '/experiment',
            name: 'list',
            component: PageView,
            redirect: '/apps/app-list',
            meta: { title: '实验管理', icon: 'experiment', permission: [  'experiment' ] },
            children: [
                {
                    path: '/experiment/admin/ExperimentList',
                    name: 'ExperimentList',
                    component: () => import('@/views/experiment/admin/MaterialList'),
                    meta: { title: '器材管理', keepAlive: true, permission: [ 'experiment' ] }
                },
                {
                    path: '/experiment/admin/MakeExperimentList',
                    name: 'MakeExperiment',
                    component: () => import('@/views/experiment/admin/MakeExperimentList'),
                    meta: { title: '实验管理', keepAlive: true, permission: [ 'experiment' ] }
                },
                {
                    path: '/experiment/admin/MakeResource',
                    name: 'resourceList',
                    component: () => import('@/views/experiment/admin/MakeResourceList'),
                    meta: { title: '资源管理', keepAlive: true, permission: [ 'experiment' ] }
                },
                {
                    path: '/experiment/admin/MyProject',
                    name: 'MyProjectList',
                    component: () => import('@/views/experiment/admin/MyProjectList'),
                    meta: { title: '我的实验', keepAlive: true, permission: [ 'experiment' ] }
                },
                {
                    path: '/experiment/admin/MyResource',
                    name: 'MyResourceList',
                    component: () => import('@/views/experiment/admin/MyResourceList'),
                    meta: { title: '我的资源', keepAlive: true, permission: [ 'experiment' ] }
                },
                {
                    path: '/experiment/admin/MyCollection',
                    name: 'MyCollectionList',
                    component: () => import('@/views/experiment/admin/MyCollectionList'),
                    meta: { title: '我的收藏', keepAlive: true, permission: [ 'experiment' ] }
                }
            ]
        },
        //实验管理  teacher experiment
        {
            path: '/t_experiment',
            name: 'list2',
            component: PageView,
            redirect: '/apps/app-list',
            meta: { title: '实验管理(teacher)', icon: 'experiment', permission: [  'experimentTeacher' ] },
            children: [
                {
                    path: '/experiment/teacher/ExperimentList',
                    name: 'ExperimentTeacherList',
                    component: () => import('@/views/experiment/teacher/MaterialList'),
                    meta: { title: '器材管理', keepAlive: true, permission: [ 'experimentTeacher' ] }
                },
                {
                    path: '/setting/teacher/MakeExperimentList',
                    name: 'MakeExperimentTeacherList',
                    component: () => import('@/views/experiment/teacher/MakeExperimentList'),
                    meta: { title: '实验管理', keepAlive: true, permission: [ 'experimentTeacher' ] }
                },
                {
                    path: '/resource/teacher/MakeResource',
                    name: 'resourceTeacherList',
                    component: () => import('@/views/experiment/teacher/MakeResourceList'),
                    meta: { title: '资源管理', keepAlive: true, permission: [ 'experimentTeacher' ] }
                },
                {
                    path: '/experiment/teacher/MyProject',
                    name: 'MyProjectList',
                    component: () => import('@/views/experiment/teacher/MyProjectList'),
                    meta: { title: '我的实验', keepAlive: true, permission: [ 'experimentTeacher' ] }
                },
                {
                    path: '/experiment/teacher/MyResource',
                    name: 'MyResourceList',
                    component: () => import('@/views/experiment/teacher/MyResourceList'),
                    meta: { title: '我的资源', keepAlive: true, permission: [ 'experimentTeacher' ] }
                },
                {
                    path: '/experiment/teacher/MyCollection',
                    name: 'MyCollectionList',
                    component: () => import('@/views/experiment/teacher/MyCollectionList'),
                    meta: { title: '我的收藏', keepAlive: true, permission: [ 'experimentTeacher' ] }
                }
            ]
        },
        //实验管理 --- student   experiment
        {
            path: '/s_experiment',
            name: 'list3',
            component: PageView,
            redirect: '/apps/app-list',
            meta: { title: '实验管理(student)', icon: 'experiment', permission: [  'experimentStudent' ] },
            children: [
                {
                    path: '/experiment/student/MyCollection',
                    name: 'MyCollection',
                    component: () => import('@/views/resource/student/MyCollectionList'),
                    meta: { title: '我的收藏', keepAlive: true, permission: [ 'experimentStudent' ] }
                }
            ]
        },
    ]
  },{
    path: '*', redirect: '/404', hidden: true
  }
]
/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import( '@/views/user/Login')
      },
      {
        path: 'register',
        name: 'register',
        component: () => import('@/views/user/Register')
      },
      {
        path: 'register-result',
        name: 'registerResult',
        component: () => import('@/views/user/RegisterResult')
      }
    ]
  },{
    path: '/test',
    component: BlankLayout,
    redirect: '/test/home',
    children: [
      {
        path: 'home',
        name: 'TestHome',
        component: () => import('@/views/Home')
      },{
            path: '/home-list',
            name: 'HomeList',
            component: () => import('@/views/home/List')
        },{
            path: '/home-detail',
            name: 'HomeDetail',
            component: () => import('@/views/home/Detail')
        },{
            path: '/home-material-list',
            name: 'HomeMaterialList',
            component: () => import('@/views/home/MaterialList')
        },{
            path: '/home-resourse-list',
            name: 'HomeResourseList',
            component: () => import('@/views/home/ResourseList')
        },{
            path: '/home-experiment-list',
            name: 'HomeExperimentList',
            component: () => import('@/views/home/ExperimentList')
        },
        {
            path: '/home-material-detail',
            name: 'HomeMaterialDetail',
            component: () => import('@/views/home/MaterialDetail')
        },
        {
            path: '/home-experiment-detail',
            name: 'HomeExperimentDetail',
            component: () => import('@/views/home/ExperimentDetail')
        }
    ],
  },{
    path: '/404',
    component: () => import('@/views/exception/404')
  },
]
